<template>
	<view class="form">
	<!-- 头部导航 -->
  <uni-nav-bar left-icon="left"    :statusBar="true" titleSize="30px" leftText="返回" right-text="新增" @clickRight="toaddInfo"   title="调拨管理"  @clickLeft="back"   :fixed="true" backgroundColor="#3286ed" color="#fff"/>
	 <view v-for="(item,index) in list"  style="overflow:hidden;background-color: #f2f2f2;">
	 	<view @click="totranfer(item)" style="padding: 10px;height: 150px;margin-top: 10px;background-color: #fff;position: relative">
	 		<view style="padding-bottom: 10px;" class="">
	 			调拨单号：<span style="font-size: 16px;">{{item.serialNum}}</span>
	 		</view>
			<view style="padding-bottom: 10px;" class="">
				调拨日期：<span style="font-size: 16px;">{{item.repTransferDate}}</span>
			</view>
			<view style="padding-bottom: 10px;" class="">
				调出仓库：<span style="font-size: 16px;">{{item.outRepertory}}</span>
			</view>
			<view style="padding-bottom: 10px;" class="">
				调入仓库：<span style="font-size: 16px;">{{item.inRepertory}}</span>
			</view>
			<view class="item" style="position:absolute;right: 120px;top:10px">
				
					<span v-if="item.equipmentStatus=='0'" style="color:#fd9540;" >待出库</span>
					<span v-if="item.equipmentStatus=='1'" style="color#fd9540;"> 出库中</span>
					<span v-if="item.equipmentStatus=='2'" style="color:#fd9540;" >待入库</span>
					<span v-if="item.equipmentStatus=='3'" style="color:#fd9540;">入库中</span>
					<span v-if="item.equipmentStatus=='4'" style="color:#fd9540;">已完结</span>
			</view>
			<view class="item" style="position:absolute;right: 30px;top:10px">
				
					<span v-if="item.logisticsStatus=='0'" style="color:#fd9540;" >物流未完成</span>
					<span v-if="item.logisticsStatus=='1'" style="color:#c7c7c7;"> 物流已完成</span>
			</view>
	 	</view>
	 </view>
	 
		
	</view>
</template>

<script>
	import {listTransfer} from '@/api/tranfer.js'
	export default {
		data() {
			return {
				list:[],
				total:0,
				pageNum:1,
				pageSize:10,
				dateNow:'',//当前时间
			};
		},
		created() {
			this.initData()
		},
		onPullDownRefresh(){
			this.initData()
			setTimeout(()=>{
				uni.stopPullDownRefresh()
			},1000)
		},
		methods:{
			// 列表数据
			async initData(){
				let res= await listTransfer() 
				this.list=res.rows
				this.total=res.total
			},
			toaddInfo(){
			uni.navigateTo({
				url:"/pages/transfer/addTransfer/addTransfer"
			})
			},
			// 获取运输方式
			getShippingTypeOptions() {
			    getDicts('biz_shipping_type').then(response => {
			        this.logisticsTypeOptionsDou = response.data
			        this.logisticsTypeOptions.push(response.data)
			        this.form.logisticsTypeName = this.getDictValue(this.logisticsTypeOptionsDou, this
			            .form.logisticsType)
			    })
				},
				getDictValue(arr, item) {
				    for (var i = 0; i < arr.length; i++) {
				        if (item == arr[i].dictValue) {
				            return arr[i].dictLabel
				        }
				    }
				},
				totranfer(val){
					uni.navigateTo({
						url:"/pages/transfer/tranferInfo/tranferInfo?id="+val.id
					})
				},
			// 跳转到新增页面
			back(){
				uni.navigateBack({delta:1})
			}
		}
	}
</script>

<style lang="scss">
.form{
	background-color: #fff;
}
</style>
